import { Component,OnInit} from '@angular/core';
import { Router } from '@angular/router';

// 引入Parse第三方库
import * as Parse from "parse"
(Parse as any).serverURL = "http://metapunk.cn:9999/parse"
Parse.initialize("dev")

@Component({
  selector: 'app-page-my',
  templateUrl: './page-my.component.html',
  styleUrls: ['./page-my.component.scss']
})
export class PageMyComponent implements OnInit  {
  goLogin(){
    this.router.navigate(["../intelligent-shopping/login"])
  }
  goSet(){
    this.router.navigate(["../intelligent-shopping/set"])
  }
  goOrder(){
    this.router.navigate(["../intelligent-shopping/order"])
  }
  userdata:Parse.User | undefined
  constructor(private router:Router){
    this.userdata = Parse.User.current();
  }

  userList:any
  async ngOnInit(): Promise<void> {

     // 查询Student
    let query = new Parse.Query("users")
//     query.equalTo("goodsID","006")
//     query.limit(1)
    let list = await query.find()
    console.log(list+"user")
this.userList = list
}

  }
 
